unit GeraRegistroCAT52;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Mask;

type
  TFormGeraRegistrosCAT52MFD = class(TForm)
    GroupBox2: TGroupBox;
    MaskEdit1: TMaskEdit;
    BitBtn1: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormGeraRegistrosCAT52MFD: TFormGeraRegistrosCAT52MFD;

implementation

uses principal, Retorno, declaracoes, funcoesapoio;

{$R *.dfm}

procedure TFormGeraRegistrosCAT52MFD.BitBtn1Click(Sender: TObject);
begin
        FormPrincipal.Statusbar1.Panels[0].Text:='Gera Registros CAT 52 MFD'; WaitProcess;
        Resposta:= ECF_GeraRegistrosCat52MFD('',MaskEdit1.Text);

        FormPrincipal.Memo1.Lines.Add('Gera Registros CAT 52 MFD:'+inttostr(Resposta));
        FormPrincipal.Memo1.Lines.Add('');

        if Resposta = 1 then
        if MessageDlg('Deseja abrir o arquivo COTEPE ?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin
                FormPrincipal.OpenDialog1.InitialDir:='C:\SWEDA\RFD\S E F A Z - ArqDigital = [CD] & [Transmitir]' ;
                FormPrincipal.OpenDialog1.Execute;
                FormRetorno.Caption:=FormPrincipal.OpenDialog1.FileName;
                FormRetorno.RichEdit1.Lines.LoadFromFile(FormPrincipal.OpenDialog1.FileName);
                FormRetorno.Show;
        end;

        VerificaRetornoFuncao(Resposta);
        Refresh;


end;

end.
